# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=pipectl
pkgver=0.4.1
pkgrel=3
pkgdesc="A simple named pipe management utility"
url="https://github.com/Ferdi265/pipectl"
arch=(loong64 x86_64)
license=(GPL3)
depends=(glibc)
makedepends=(
  cmake
  ninja
  scdoc
)
source=(pipectl-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)
sha512sums=('812993da6a274dc4965d1aec93ff557a421881159be1b457621488dcc74b673a6cddfa39cd2c0f22723036d71289341f3702771de6ff47b28f02a4721dd99260')
b2sums=('bcaba2dfaae58264549b351bedd425c8e984962eaaf1931e48986572564a19394d0656ddcc9acb09bf639c394d0ffb1b7ca767fe6c882df168596f21a62401b2')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D INSTALL_DOCUMENTATION=ON
    -G Ninja
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
